let obj = {  //Object
    name: "zhangsan",
    age: 18,
    headth: 100,
    say: function () { //Function
        console.log("hello");

    },
    drink: function () { //Function, 
        console.log("drink");
        obj.headth--
    }
}

// obj.age++;

// obj.drink()//drink
// console.log(obj.headth);


// obj.somking = function () { //Function,
//     console.log("somking");
//     obj.headth--
// }
//外部作用域是全局，要先访问obj,才能再访问headth
meiGirl = "张若男"
// obj.meiGirl = "lisi"//meiGirl是字符串

obj[meiGirl] = "xxx"//meiGirl是变量
console.log(obj[meiGirl]);



// delete obj.drink //删除属性

// let obj2 = new Object({
//     name: "lisi",
//     age: 18,
//     headth: 100
// }) //Object



// console.log(obj)

